package fn;

public class Variable extends Function {

	private static final long serialVersionUID = -5207548344770801252L;

	private Variable() {}

	public static Function create() {
		return new Variable();
	}

	@Override
	protected Function[] child() {
		return null;
	}

	@Override
	public double evaluate(double sub) {
		return sub;
	}

	@Override
	public String prefix() {
		return "x";
	}

	@Override
	public String infix() {
		return "";
	}

	@Override
	public String postfix() {
		return "";
	}

	@Override
	protected int precedence() {
		return Integer.MAX_VALUE;
	}

	@Override
	protected boolean withPar() {
		return false;
	}

	@Override
	public Function derivative() {
		return Constant.ONE;
	}
}
